package com.aidex.common.core.domain;

import com.alibaba.fastjson2.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * @Author su
 * @Date 2023/3/7 23:50
 */
@Data
public class BasePlusEntity implements Serializable {

    /**
     * 删除标记（0：正常；1：删除；）
     */
    public static final String DEL_FLAG_NORMAL = "0";
    public static final String DEL_FLAG_DELETE = "1";

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;


    /**
     * 创建者
     */
    @TableField(value = "create_by", fill = FieldFill.INSERT)
    private String createBy;

    /**
     * 创建部门
     */
    @TableField(value = "create_dept", fill = FieldFill.INSERT)
    private String createDept;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;

    /**
     * 更新者
     */
    @TableField(value = "update_by", fill = FieldFill.INSERT_UPDATE)
    private String updateBy;

    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    /**
     * 更新IP
     */
    @TableField(value = "update_ip", fill = FieldFill.INSERT_UPDATE)
    private String updateIp;

    /**
     * 备注
     */
    private String remark;

    /**
     * 版本
     */
    @TableField(value = "version", fill = FieldFill.INSERT_UPDATE)
    private Integer version;


    @TableField(value = "del_flag", fill = FieldFill.INSERT)
    @TableLogic
    protected String delFlag;




}
